<script lang="ts" setup name="GatewayBlackPage">
import { onMounted } from 'vue';

import { useFs } from '@fast-crud/fast-crud';

import createCrudOptions from './crud';

// 通过context传递到crud.tsx中
const { crudBinding, crudRef, crudExpose } = useFs({
  createCrudOptions,
  context: {
    // // 定义权限位前缀
    // permission: 'gateway:blak',
  },
});

// 页面打开后获取列表数据
onMounted(async () => {
  await crudExpose.doRefresh();
});
</script>

<template>
  <fs-page class="page-layout-card">
    <fs-crud v-if="crudBinding" ref="crudRef" v-bind="crudBinding">
      <template #actionbar-right>
        <a-alert
          class="ml-1"
          message="限访名单存储在Redis中，为了查询方便做的本地分页，一般黑名单也不会太多"
          style="margin-top: 10px"
          type="info"
        />
      </template>
    </fs-crud>
  </fs-page>
</template>
